#!/bin/bash
filename="test.data"
line_no=0
mod=0
green='\e[0;32m'
red='\e[0;31m'
NC='\e[0m' # No Color
while read -r line
do
    let line_no+=1
    let mod=line_no%3

    if [ $mod -eq 1 ]; then
        res=`./test.sh "$line"`
        echo "$line / $res"
    fi

    if [ $mod -eq 2 ]; then
        echo "$line"
        if [ "$line" == "$res" ]; then
            echo -e "${green}PASS${NC}"
        else
            echo -e "${red}FAIL${NC}"
#            exit
        fi
    fi
done < "$filename"

